/*!
 @file NSError+MujiVideo.h
 @framework ECCoreLibrary

 @author Created by Matthew Austin.
 @copyright Copyright (c) 2013 MujiVideo. All rights reserved.
*/

#import <Foundation/Foundation.h>
//#import "MujiEnums.h"

/*!
 @abstract Defines the MujiVideo SDK Error codes.
 */
typedef NS_ENUM(NSUInteger, MujiVideoErrorCode){
    /*!
     
     */
    MujiVideoErrorCodeUnknown,
    /*!
     
     */
    MujiVideoErrorCodeGeneral,
    /*!
     
     */
    MujiVideoErrorCodeWavParserIncorrectFileSize,
    /*!
     
     */
    MujiVideoErrorCodeWavParserContainerIDNotFound,
    /*!
     
     */
    MujiVideoErrorCodeWavParserFormatIDNotFound,
    /*!
     
     */
    MujiVideoErrorCodeWavParserDataChunkIDNotFound,
    /*!
     
     */
    MujiVideoErrorCodeWavParserAudioPropertiesNotExtracted,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderFailedToAllocateEncoderState,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderFailedToSetUpResampler,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderFailedToObtainFrameSize,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderFailedToObtainBitrate,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderFailedToSetQuality,
    /*!
     
     */
    MujiVideoErrorCodeSpeexEncoderNotEnoughDataToCreateSpeexHeader,
    /*!
     
     */
    MujiVideoErrorCodeOggFailedToAllocateStreamState,
    /*!
     
     */
    MujiVideoErrorCodeFailedToCreateFile,
    /*!
     
     */
    MujiVideoErrorCodeInvalid,
    /*!
     
     */
    MujiVideoErrorCodeAssetNotPlayable,
    /*!
     
     */
    MujiVideoErrorCodeAssetBadMediaURL,
    /*!
     
     */
    MujiVideoErrorCodeAssetFailedLoading,
    /*!
     
     */
    MujiVideoErrorCodeAssetMaximumRetryReached,
    /*!
     
     */
    MujiVideoErrorCodeAssetPlaybackTimeout,
    /*!
     
     */
    MujiVideoErrorCodeDownloadingOfContentFailed,
    /*!
     
     */
    MujiVideoErrorCodeUserAccountNotLoggedIn,
    /*!
     
     */
    MujiVideoErrorCodeUserAccountDoesNotContainStudentClassIDs,
    /*!
     
     */
    MujiVideoErrorCodePurchasedInAppProductNotFound,
    /*!
     
     */
    MujiVideoErrorCodeCannotConnectToAppStore,
    /*!
     
     */
    MujiVideoErrorCodeFailedToProcessPayment,
    /*!
     
     */
    MujiVideoErrorCodeSpeechDialogLineAnalysisResultRejected,
    MujiVideoErrorCodeGenericSpeechAnalysisError,
    MujiVideoErrorCodeInvalidDialogLineSpeechUploadRecord,
    MujiVideoErrorCodeInvalidDeviceToken,
    MujiVideoErrorCodeAccountRegistrationFailure,
    MujiVideoErrorCodeMediaCacheImageDownloadFailure,
    MujiVideoErrorCodeMediaCacheAudioDownloadFailure,
    MujiVideoErrorCodeMediaCacheInvalidURL,
    MujiVideoErrorCodeRequestSerializationInvalidRequest,
    /*
     Paywall Error Codes
     */
    MujiVideoErrorCodeInAppPurchaseNotEnabled,
    MujiVideoErrorCodePaymentAlreadyProcessing,
    MujiVideoErrorCodePaymentAlreadyPurchased,
    MujiVideoErrorCodePaymentIsRestoring,
    MujiVideoErrorCodePaymentIsPendingExternalAction,
    MujiVideoErrorCodeUnableToCompleteTransaction,
    MujiVideoErrorCodeSocialShareUserCancelled,
    MujiVideoErrorCodeSocialShareGeneralError,
    MujiVideoErrorCodeSocialShareNativeFacebookAppNotInstalled,
    
    /*
     Account Errors.
     */
    MujiVideoErrorCodeMissingEmailPasswordError
};



/*!
 @protocol NSError (MujiVideo)
 */
@interface NSError (MujiVideo)

/*!
 @method
 
 @param errorCode
 
 @return NSError
 */
+ (NSError *)errorWithCode:(MujiVideoErrorCode)errorCode;

/*!
 @method
 
 @param errorCode
 
 @return NSString
 */
+ (NSString *)localizedDescriptionWithCode:(MujiVideoErrorCode)errorCode;

/*!
 @method
 
 @param errorCode
 
 @return NSString
 */
+ (NSString *)localizedFailureReasonWithCode:(MujiVideoErrorCode)errorCode;

/*!
 @method
 
 @param errorCode
 
 @return NSArray.
 */
+ (NSArray *)localizedRecoveryOptionsWithCode:(MujiVideoErrorCode)errorCode;

/*!
 @method
 
 @return BOOL
 */
- (BOOL)isIdentifyingNetworkConnectionIssue;

/*!
 @method
 
 @return BOOL
 */
- (BOOL)isUnauthorizedError;

@end
